package edu.polsl.bio.str.node.delegate;

import edu.polsl.bio.str.common.exception.ManagerException;
import edu.polsl.bio.str.common.messaging.StrDotsPayload;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * //todo class description
 * <p/>
 * Created on: Jun 21, 2011 11:05:47 AM <br/>
 * <a href="http://www.polsl.pl">www.polsl.pl</a>
 *
 * @author lukasz.olczak@polsl.pl
 */
public class DotPlotServiceDelegateImpl extends BaseNodeDelegate implements DotPlotServiceDelegate {
  /**
   * slf4j Logger.
   */
  private static final Logger log = LoggerFactory.getLogger(DotPlotServiceDelegateImpl.class.getName());

  @Override
  public void sendResults(StrDotsPayload results) throws ManagerException {
    log.debug("Sending results...");
    try {
      getServiceLocator().getDotPlotService().sendResults(results);
      log.debug("Results sent");
    } catch (ManagerException me) {
      log.error("Error while sending results");
      throw me;
    } catch (Exception e) {
      throw createCommunicationException(e);
    }
  }
}
